package team.xyg.cdtu2.controller;

import team.xyg.cdtu2.dto.MapData;
import team.xyg.cdtu2.entity.ProvinceOfSales;
import team.xyg.cdtu2.service.ProvinceOfSalesService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (ProvinceOfSales)表控制层
 *
 * @author makejava
 * @since 2022-07-01 11:58:17
 */
@RestController
@RequestMapping("provinceOfSales")
public class ProvinceOfSalesController {
    /**
     * 服务对象
     */
    @Resource
    private ProvinceOfSalesService provinceOfSalesService;



    @GetMapping("map")
    public Map<String,Object> queryMapData(){

        //加载地图数据 省份+累计确诊数据
        List<MapData> map_data=provinceOfSalesService.queryMapData();
        Map<String,Object> result = new HashMap<>();
        result.put("code",200);
        result.put("message","success");
        result.put("data",map_data);


        return result;
    }






}

